<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>后台管理系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" type="text/css" href="../../../static/layui/css/layui.css" media="all">
    <link rel="stylesheet" type="text/css" href="../../../static/bews/css/index.css" media="all">
    <script type="text/javascript" src="../../../static/layui/layui.js"></script>
    <script type="text/javascript" src="../../../static/bews/js/admin.js"></script>
    <style>
        .layadmin-side-shrink .layui-layout-admin .layui-logo {
            width: 60px;
            background-image:url("../../../static/bews/images/logob32.jpg");
        }
    </style>
</head>
<body layadmin-themealias="default" class="layui-layout-body">
<div id="LAY_app" class="layadmin-tabspage-none">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <!-- 头部区域 -->
            <ul class="layui-nav layui-layout-left">
                <li class="layui-nav-item layadmin-flexible" lay-unselect onclick="shrink()">
                    <a href="javascript:;" layadmin-event="flexible" title="侧边伸缩">
                        <i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
                    </a>
                </li>
            </ul>
            <ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">
                <li class="layui-nav-item layui-hide-xs" lay-unselect title="全屏" onclick="fullScreen()">
                    <a href="javascript:;" layadmin-event="fullscreen">
                        <i class="layui-icon layui-icon-screen-full"></i>
                    </a>
                </li>
                <li class="layui-nav-item" lay-unselect>
                    <a href="javascript:;">
                        <cite>{$user['name']}</cite>
                    </a>
                    <dl class="layui-nav-child">
                        <dd><a lay-href="">个人中心</a></dd>
                        <hr>
                        <dd layadmin-event="logout" style="text-align:center;" onclick="logout()">
                            <a>退出</a>
                        </dd>
                    </dl>
                </li>
            </ul>
        </div>
        <!-- 侧边菜单 -->

        <div class="layui-side layui-side-menu">
            <div class="layui-side-scroll">
                <div class="layui-logo" lay-href="">
                    <span>后台管理系统</span>
                </div>
                <ul class="layui-nav layui-nav-tree" lay-shrink="all" id="LAY-system-side-menu" lay-filter="layadmin-system-side-menu">
                    {volist name="menu" id="vo"}
                    <li data-name="" data-jump="" class="layui-nav-item">
                        <a href="javascript:;" lay-tips="系统配置" lay-direction="2">
                            <i class="layui-icon layui-icons layui-icon-set"></i>
                            <cite>{$vo.label}</cite>
                        </a>
                        {if (isset($vo['children']) && $vo['children'])}
                        <dl class="layui-nav-child">
                            {volist name="vo.children" id="cvo"}
                            <dd data-name="" data-jump="/">
                                {if $cvo['type'] == 1}
                                <a href="javascript:;" onclick="menuFire('{$cvo.src}')">
<!--                                    {$cvo.src}-->
                                    <i class="layui-icon layui-icons layui-icon-group"></i>{$cvo.label}
                                </a>
                                {elseif $cvo['type'] == 2 /}
                                <a href="{$cvo.src}" target="_blank">
                                    <i class="layui-icon layui-icons layui-icon-group"></i>{$cvo.label}
                                </a>
                                {/if}
                            </dd>
                            {/volist}
                        </dl>
                        {/if}
                    </li>
                    {/volist}
                </ul>
            </div>
        </div>
        <!-- 主体内容 -->
        <div class="layui-body" id="LAY_app_body">
            <div class="layadmin-tabsbody-item layui-show">
                <div class="layui-fluid">
                    <div class="layui-card">
                        <iframe src="./welcome" style="width:100%;height:100%;" frameborder="0" scrolling="0"></iframe>
                    </div>
                </div>
            </div>
        </div>
        <!-- 辅助元素，一般用于移动设备下遮罩 -->
        <div class="layadmin-body-shade" layadmin-event="shade" onclick="shrink()"></div>
    </div>
</div>
<!-- 辅助元素，一般用于移动设备下遮罩 -->
<div class="layadmin-body-shade" layadmin-event="shade"></div>
</div></div>
<script type="text/javascript">
    layui.use(['element','layer','jquery'], function(){
        element = layui.element;
        $ = layui.jquery;
        layer = layui.layer;
        setter = layui.setter;
        resetMainHeight($("iframe"));
    });
    // 重新设置主操作页面高度
    function resetMainHeight(obj){
        var height = parent.document.documentElement.clientHeight - 80;
        $(obj).parent('div').height(height);
    }
    // 菜单点击
    function menuFire(obj){
        $('iframe').attr('src',obj);
        var width = screen();
        if(width < 2){
            shrink();
        }
    }

    function logout(){
        layer.confirm('确认退出登录吗?',{
            icon:3,
            btn:['确认','取消']
        },function (){
            $.get("/tp5/public/index.php/bews/login/logout",function (res){
                if(res.code === 0){
                    layer.msg(res.msg,{'icon':1})
                    setTimeout(function (){

                        window.location.href = "/tp5/public/index.php/bews/Login/index"
                    },1000)

                }else{
                    layer.msg(res.msg,{'icon':2})
                }
            },'json')
        })
    }
</script>
</body>
</html>